package com.prs.crm.dao.hr.impl;

import java.util.Collection;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;

import com.prs.crm.dao.hr.SalaryItemDao;
import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.domain.hr.SalaryItem;

public class SalaryItemDaoImpl extends BaseDaoImpl<SalaryItem> implements SalaryItemDao{

	@Override
	public Collection<SalaryItem> getAllSalaryItems() {
		return (Collection<SalaryItem>)this.getHibernateTemplate().execute(
				new HibernateCallback()
				{
					public Object doInHibernate(Session session) throws HibernateException {
			        	Criteria criteria = session.createCriteria(SalaryItem.class);
			        	return criteria.list();
			        }   
				}
		);
	}

}
